<?php
//首页

namespace front\modules\app\controllers;

use Yii;
use front\models\BannerModel;
use yii\data\ActiveDataProvider;
use common\WebController;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use wechat\services\BannerService;
use wechat\services\ThemeService;
use front\controllers\WebBaseController;
/**
 * BannerController implements the CRUD actions for BannerModel model.
 */
class BannerController extends WebBaseController
{
    public $enableCsrfValidation = false;
    public function behaviors()
    {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['post'],
                ],
            ],
        ];
    }



    /**
     * Lists all BannerModel models.
     * @return mixed
     * banner
     */
    public function actionBanner()
    {
       $banner = BannerService::getBanners();
        WebBaseController::getAjaxData(1,'获取成功',$banner);
    }

    /**
     * 专题
     */
    function actionTheme(){
        $theme = ThemeService::getTheme();
        WebBaseController::getAjaxData(1,$theme['message'],$theme['result']);
    }

}
